<!DOCTYPE html>
<html lang="zh-CN">
@include('admin.head')

<body>

@include('admin.topNav')

<div class="container-fluid">
    <div class="row">
        @include('admin.leftNav')
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            @if(session('__Ajax_RedirectFunc_status') == true)
                <div>
                    <div class="alert alert-success alert-dismissible fade in" role="alert">
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <h3>成功</h3>
                        <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
                        <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
                    </div>
                </div>
            @endif
            @if(session('__Ajax_RedirectFunc_status') === false)
                <div >
                    <div class="alert alert-danger alert-dismissible fade in" role="alert">
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <h3>失败</h3>
                        <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
                        <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
                    </div>
                </div>
            @endif
            <h2 class="page-header">添加业务</h2>

            <div class="panel-body" >
                <form enctype="multipart/form-data" class="form-horizontal" role="form" method="post" action="/_addService">
                    <input type="hidden" name="_token" value="{{csrf_token()}}">
                    <div class="modal-body">
                        <div class="form-group">
                            <label>请输入业务名称</label>
                            <input type="text" name="service_name" class="form-control"  required autofocus>
                        </div>
                        <div class="form-group">
                            <label>请输入业务价格</label>
                            <input type="text" name="service_price" class="form-control" required autofocus>
                        </div>
                        <div class="form-group">
                            <label>请输入业务介绍</label>
                            <div id="editor"></div>
                            <input id="text1" type="hidden" name="service_info">
                            <!-- 注意， 只需要引用 JS，无需引用任何 CSS ！！！-->
                            <script src="{{asset('/jquery.js')}}"></script>
                            <script type="text/javascript" src="/wangEditor.min.js"></script>
                            <script type="text/javascript">
                                var E = window.wangEditor
                                var editor = new E('#editor')
                                editor.customConfig.uploadImgShowBase64 = true   // 使用 base64 保存图片
                                editor.customConfig.showLinkImg = false // 隐藏“网络图片”tab
                                var $text1 = $('#text1')
                                editor.customConfig.onchange = function (html) {
                                    // 监控变化，同步更新到 textarea
                                    $text1.val(html)
                                }

                                editor.create()
                                // 初始化 input 的值
                                $text1.val(editor.txt.html())
                            </script>
                        </div>
                    </div>
                    <div style="text-align: center">
                        <button type="submit" class="btn btn-primary">确定</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</body>
</html>